<UserControl x:Class="SiliconStudio.Meet.EjpControls.XpsDocumentViewer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ejpConstrols="clr-namespace:SiliconStudio.Meet.EjpControls.Helpers"
    xmlns:annotations="clr-namespace:System.Windows.Annotations;assembly=PresentationFramework"
    xmlns:System_Windows_Documents="clr-namespace:System.Windows.Documents;assembly=PresentationUI">
    <UserControl.Resources>

        <LinearGradientBrush x:Key="LineHandleDefaultBGBrush" StartPoint="0.499979,-5.31378e-005" EndPoint="0.499979,1.15269">
            <LinearGradientBrush.GradientStops>
                <GradientStop Color="#80FFFFFF" Offset="0"/>
                <GradientStop Color="#80C61922" Offset="1"/>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>
        
        <LinearGradientBrush x:Key="LineHandleSelectedBGBrush">
            <LinearGradientBrush.GradientStops>
                <GradientStop Color="#FFF8E883" Offset="0"/>
                <GradientStop Color="#FFFBF5B6" Offset="0.139"/>
                <GradientStop Color="#FFF8E279" Offset="1"/>
                <GradientStop Color="#FFFCB142" Offset="0.562"/>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <DrawingBrush x:Key="lineHandleS_default">
           <DrawingBrush.Drawing>
                    <DrawingGroup>
                        <DrawingGroup.Children>
                            <GeometryDrawing Brush="#A6C61A23" Geometry="F1 M 402.408,304.018L 402.444,311.977L 398,311.977L 398,296.023L 410,296.023L 402.408,304.018 Z "/>
                        </DrawingGroup.Children>
                    </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="lineHandleE_default">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Brush="#A6C61A23" Geometry="F1 M 405.591,303.982L 405.555,296.023L 410,296.023L 410,311.977L 398,311.977L 405.591,303.982 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="lineHandleS_selected">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Brush="{StaticResource LineHandleSelectedBGBrush}" Geometry="F1 M 410,309.227C 410,310.759 408.759,312 407.228,312L 400.772,312C 399.241,312 398,310.759 398,309.227L 398,298.773C 398,297.241 399.241,296 400.772,296L 407.228,296C 408.759,296 410,297.241 410,298.773L 410,309.227 Z "/>
                        <GeometryDrawing Brush="#C0FFFFFF" Geometry="F1 M 400.602,303.844L 403.384,301.545L 406.167,299.248L 406.167,303.844L 406.167,308.438L 403.384,306.142L 400.602,303.844 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="lineHandleE_selected">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Brush="{StaticResource LineHandleSelectedBGBrush}" Geometry="F1 M 410,309.227C 410,310.759 408.759,312 407.228,312L 400.772,312C 399.241,312 398,310.759 398,309.227L 398,298.773C 398,297.241 399.241,296 400.772,296L 407.228,296C 408.759,296 410,297.241 410,298.773L 410,309.227 Z "/>
                        <GeometryDrawing Brush="#C0FFFFFF" Geometry="F1 M 407.5,303.844L 404.716,301.545L 401.935,299.248L 401.935,303.844L 401.935,308.438L 404.716,306.142L 407.5,303.844 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>


        <DrawingBrush x:Key="MinusButton_def">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Geometry="F1 M 26.6667,26.6667L 0,26.6667L 0,0L 26.6667,0L 26.6667,26.6667 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="1.33333" LineJoin="Round" Brush="#FF809AB6"/>
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.49997,3.64014e-007" EndPoint="0.49997,0.952404">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                        <GradientStop Color="#FFCECBD3" Offset="1"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FF060202" Geometry="F1 M 21.5,14.8333L 5.16667,14.8333L 5.16667,11.8333L 21.5,11.8333L 21.5,14.8333 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="MinusButton_pressed">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Geometry="F1 M 26.6667,26.6667L 0,26.6667L 0,0L 26.6667,0L 26.6667,26.6667 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="1.33333" LineJoin="Round" Brush="#FF809AB6"/>
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.49997,0.0178575" EndPoint="0.49997,0.982167">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#FFA8C7E6" Offset="0"/>
                                        <GradientStop Color="#FFABCAEA" Offset="0.264038"/>
                                        <GradientStop Color="#FFFFFFFF" Offset="0.870789"/>
                                        <GradientStop Color="#FFA6CBEC" Offset="0.960678"/>
                                        <GradientStop Color="#FFA6CBEC" Offset="1"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FF060202" Geometry="F1 M 21.5,14.8333L 5.16667,14.8333L 5.16667,11.8333L 21.5,11.8333L 21.5,14.8333 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="PlusButton_def">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Geometry="F1 M 26.6667,26.6667L 0,26.6667L 0,0L 26.6667,0L 26.6667,26.6667 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="1.33333" LineJoin="Round" Brush="#FF809AB6"/>
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.49997,3.64014e-007" EndPoint="0.49997,0.952404">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                        <GradientStop Color="#FFCECBD3" Offset="1"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FF060202" Geometry="F1 M 21.4998,11.8333L 14.8331,11.8333L 14.8331,5.16666L 11.8331,5.16666L 11.8331,11.8333L 5.16642,11.8333L 5.16642,14.8333L 11.8331,14.8333L 11.8331,21.5L 14.8331,21.5L 14.8331,14.8333L 21.4998,14.8333L 21.4998,11.8333 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="PlusButton_pressed">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Geometry="F1 M 26.6667,26.6667L 0,26.6667L 0,0L 26.6667,0L 26.6667,26.6667 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="1.33333" LineJoin="Round" Brush="#FF809AB6"/>
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.49997,0.0178575" EndPoint="0.49997,0.982167">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#FFA8C7E6" Offset="0"/>
                                        <GradientStop Color="#FFABCAEA" Offset="0.264038"/>
                                        <GradientStop Color="#FFFFFFFF" Offset="0.870789"/>
                                        <GradientStop Color="#FFA6CBEC" Offset="0.960678"/>
                                        <GradientStop Color="#FFA6CBEC" Offset="1"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FF060202" Geometry="F1 M 21.4998,11.8333L 14.8331,11.8333L 14.8331,5.16666L 11.8331,5.16666L 11.8331,11.8333L 5.16642,11.8333L 5.16642,14.8333L 11.8331,14.8333L 11.8331,21.5L 14.8331,21.5L 14.8331,14.8333L 21.4998,14.8333L 21.4998,11.8333 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="commentBubbleDrawing">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Geometry="F1 M 293.052,159.267L 304.198,159.267L 317.185,111.556L 329.125,159.267L 402.059,159.267C 422.277,159.267 438.667,178.239 438.667,201.642L 438.667,270.069C 438.667,293.472 422.277,312.444 402.059,312.444L 293.052,312.444C 272.834,312.444 256.444,293.472 256.444,270.069L 256.444,201.642C 256.444,178.239 272.834,159.267 293.052,159.267 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="5" LineJoin="Round" Brush="#FF2AB7D1"/>
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.5,1.01568" EndPoint="0.5,-0.0156807">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#FF058198" Offset="0"/>
                                        <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Geometry="F1 M 295.667,164.547L 398.667,164.547C 415.235,164.547 428.667,177.979 428.667,194.547L 428.667,199.556C 428.667,216.124 415.235,229.556 398.667,229.556L 295.667,229.556C 279.098,229.556 265.667,216.124 265.667,199.556L 265.667,194.547C 265.667,177.979 279.098,164.547 295.667,164.547 Z ">
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.5,1.73016" EndPoint="0.5,-0.730161">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#27FFFFFF" Offset="0"/>
                                        <GradientStop Color="#27FFFFFF" Offset="1"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Geometry="F1 M 295.667,239.66L 398.667,239.66C 415.235,239.66 428.667,253.091 428.667,269.66L 428.667,274.668C 428.667,291.237 415.235,304.668 398.667,304.668L 295.667,304.668C 279.098,304.668 265.667,291.237 265.667,274.668L 265.667,269.66C 265.667,253.091 279.098,239.66 295.667,239.66 Z ">
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.5,-0.73016" EndPoint="0.5,1.73016">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#27FFFFFF" Offset="0"/>
                                        <GradientStop Color="#27FFFFFF" Offset="1"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Geometry="F1 M 280.556,190L 410.778,190">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="10" LineJoin="Round" Brush="#FF307AA0"/>
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>
                        <GeometryDrawing Geometry="F1 M 280.556,234L 410.778,234">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="10" LineJoin="Round" Brush="#FF307AA0"/>
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>
                        <GeometryDrawing Geometry="F1 M 280.556,274.445L 410.778,274.445">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="10" LineJoin="Round" Brush="#FF307AA0"/>
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="scaleLockToPageWidth">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Geometry="F1 M 0,0L 46.6673,0L 46.6673,26.6667L 0,26.6667L 0,0 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="1.33333" LineJoin="Round" Brush="#FF839EBC"/>
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.49998,0.0238095" EndPoint="0.49998,0.976214">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                        <GradientStop Color="#FFCFCCD4" Offset="1"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Geometry="F1 M 31.7012,17.5833L 14.9661,17.5833L 14.9661,9.08334L 31.7012,9.08334L 31.7012,17.5833 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="1.33333" LineJoin="Round" Brush="#FF1D2088"/>
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FF1D2088" Geometry="M 8.79297,16.8099L 10.3255,16.7344L 7.85156,14.2604L 14.3503,14.2383L 14.3503,13.099L 7.77604,13.1224L 10.25,10.612L 8.79297,10.5365L 5.65625,13.6745L 8.79297,16.8099 Z "/>
                        <GeometryDrawing Brush="#FF1D2088" Geometry="M 37.8809,10.5365L 36.347,10.612L 38.821,13.0859L 32.3236,13.1094L 32.3236,14.2474L 38.8965,14.224L 36.4225,16.7344L 37.8809,16.8099L 41.0163,13.6719L 37.8809,10.5365 Z "/>
                        <GeometryDrawing Brush="#FF1D2088" Geometry="M 20.1992,5.50781L 20.2747,7.03906L 22.748,4.56509L 22.7715,9.70313L 23.9095,9.70313L 23.8861,4.48959L 26.3965,6.96353L 26.472,5.50781L 23.334,2.36978L 20.1992,5.50781 Z "/>
                        <GeometryDrawing Brush="#FF1D2088" Geometry="M 26.472,21.2318L 26.3965,19.7005L 23.9225,22.1745L 23.8991,17.0365L 22.7611,17.0365L 22.7845,22.25L 20.2747,19.776L 20.1992,21.2318L 23.3366,24.3698L 26.472,21.2318 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>

        <DrawingBrush x:Key="scaleLockToPageWidth_pressed">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Geometry="F1 M 46.6667,26.6667L 0,26.6667L 0,0L 46.6667,0L 46.6667,26.6667 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="1.33333" LineJoin="Round" Brush="#FF839EBC"/>
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush StartPoint="0.5,0.0178575" EndPoint="0.5,0.982144">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStop Color="#FFF8E883" Offset="0"/>
                                        <GradientStop Color="#FFFBF5B6" Offset="0.139"/>
                                        <GradientStop Color="#FFF8E279" Offset="1"/>
                                        <GradientStop Color="#FFFCB142" Offset="0.562"/>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>
                        <GeometryDrawing Geometry="F1 M 31.7005,17.5833L 14.9661,17.5833L 14.9661,9.08334L 31.7005,9.08334L 31.7005,17.5833 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="1.33333" LineJoin="Round" Brush="#FF1D2088"/>
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FF1D2088" Geometry="M 8.79297,16.8099L 10.3255,16.7344L 7.85156,14.2604L 14.3503,14.2383L 14.3503,13.099L 7.77604,13.1224L 10.25,10.612L 8.79297,10.5365L 5.65625,13.6745L 8.79297,16.8099 Z "/>
                        <GeometryDrawing Brush="#FF1D2088" Geometry="M 37.8802,10.5365L 36.3477,10.612L 38.8216,13.0859L 32.3229,13.1094L 32.3229,14.2474L 38.8971,14.224L 36.4232,16.7344L 37.8802,16.8099L 41.0169,13.6719L 37.8802,10.5365 Z "/>
                        <GeometryDrawing Brush="#FF1D2088" Geometry="M 20.1992,5.50781L 20.2747,7.03906L 22.7487,4.56509L 22.7721,9.70313L 23.9102,9.70313L 23.8867,4.48959L 26.3971,6.96353L 26.4727,5.50781L 23.3346,2.36978L 20.1992,5.50781 Z "/>
                        <GeometryDrawing Brush="#FF1D2088" Geometry="M 26.4727,21.2318L 26.3971,19.7005L 23.9232,22.1745L 23.8997,17.0365L 22.7617,17.0365L 22.7852,22.25L 20.2747,19.776L 20.1992,21.2318L 23.3372,24.3698L 26.4727,21.2318 Z "/>
                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>


        <ejpConstrols:ZoomToString x:Key="ZoomToStringConverter"/>
        <Style x:Key="SimpleDocViewerStyle" BasedOn="{x:Null}" TargetType="{x:Type DocumentViewer}">
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="ContextMenu" Value="{DynamicResource {ComponentResourceKey ResourceId=PUIDocumentViewerContextMenu, TypeInTargetAssembly={x:Type System_Windows_Documents:PresentationUIStyleResources}}}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DocumentViewer}">
                        <Border Focusable="False" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <Grid Background="{TemplateBinding Background}" KeyboardNavigation.TabNavigation="Local">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <ScrollViewer Focusable="{TemplateBinding Focusable}" IsTabStop="true" TabIndex="1" x:Name="PART_ContentHost" Grid.Column="0" Grid.Row="1" CanContentScroll="true" HorizontalScrollBarVisibility="Auto"/>
                                <DockPanel Grid.Row="1">
                                    <FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right"/>
                                </DockPanel>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <ControlTemplate x:Key="MTB_scalelock" TargetType="{x:Type ToggleButton}">
            <Grid>
                <Rectangle Fill="#FFFFFFFF" Stroke="{x:Null}" StrokeThickness="0" Margin="0,0,0,0" x:Name="rectangle"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsChecked" Value="False">
                    <Setter TargetName="rectangle" Property="Fill" Value="{StaticResource scaleLockToPageWidth}"/>
                </Trigger>
                <Trigger Property="IsChecked" Value="True">
                    <Setter TargetName="rectangle" Property="Fill" Value="{StaticResource scaleLockToPageWidth_pressed}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <ControlTemplate x:Key="B_zoomPlus" TargetType="{x:Type Button}">
            <Grid>
                <Rectangle Fill="#FFFFFFFF" Stroke="{x:Null}" StrokeThickness="0" Margin="0,0,0,0" x:Name="rectangle"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsPressed" Value="False">
                    <Setter TargetName="rectangle" Property="Fill" Value="{StaticResource PlusButton_def}"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter TargetName="rectangle" Property="Fill" Value="{StaticResource PlusButton_pressed}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <ControlTemplate x:Key="B_zoomMinus" TargetType="{x:Type Button}">
            <Grid>
                <Rectangle Fill="#FFFFFFFF" Stroke="{x:Null}" StrokeThickness="0" Margin="0,0,0,0" x:Name="rectangle"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsPressed" Value="False">
                    <Setter TargetName="rectangle" Property="Fill" Value="{StaticResource MinusButton_def}"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter TargetName="rectangle" Property="Fill" Value="{StaticResource MinusButton_pressed}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

    </UserControl.Resources>

    <Grid>
        <DocumentViewer Margin="0,25,0,25" ScrollViewer.HorizontalScrollBarVisibility="Auto"
                        Style="{DynamicResource SimpleDocViewerStyle}"
                    ScrollViewer.VerticalScrollBarVisibility="Visible" x:Name="_dA_DV_DocumentViewer">

            <DocumentViewer.ContextMenu>
                <ContextMenu x:Name="_cm_DocumentLineContextMenu">
                    <MenuItem Header="Add Comment" Click="OnAddNoteToDocumentLine" />
                    <MenuItem Header="Remove Comment" Click="OnRemoveNoteFromDocumentLine" />
                </ContextMenu>
            </DocumentViewer.ContextMenu>
            
        </DocumentViewer>

        <Button Command="NavigationCommands.DecreaseZoom" 
            CommandTarget="{Binding ElementName=_dA_DV_DocumentViewer}" 
            Height="22" Width="22" HorizontalAlignment="Right" Template="{DynamicResource B_zoomMinus}"
            Margin="0,0,230,0" VerticalAlignment="Bottom" Click="OnZoomDocumentOut" Visibility="Collapsed" />
        
        <Button Command="NavigationCommands.IncreaseZoom" 
            CommandTarget="{Binding ElementName=_dA_DV_DocumentViewer}" 
            Width="22" Height="22" HorizontalAlignment="Right" Template="{DynamicResource B_zoomPlus}"
            Margin="0,0,104.052,0" VerticalAlignment="Bottom" Click="OnZoomDocumentIn" Visibility="Collapsed" />

        <ToggleButton Checked="OnToggleScaleLock" Unchecked="OnToggleScaleLock"
                      Template="{DynamicResource MTB_scalelock}"
            Height="22" HorizontalAlignment="Right" Width="44"
            Margin="0,0,16,0" VerticalAlignment="Bottom"
                      x:Name="_tb_ScaleLock">
            <ToggleButton.ToolTip>
                <StackPanel>
                    <Label Padding="1,5,1,1" FontSize="12" FontWeight="Bold"></Label>
                    <TextBlock Margin="5,2,3,0" Padding="1,1,1,5" FontSize="10" ></TextBlock>
                </StackPanel>
            </ToggleButton.ToolTip>
        </ToggleButton>

        <Label Height="18" Content="{Binding ElementName=_dA_DV_DocumentViewer, Path=Zoom, Converter={StaticResource ZoomToStringConverter}}" 
               Padding="0,0,0,0" VerticalContentAlignment="Center" Margin="0,0,65.366,3" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="34.884" />

        <Slider VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="100" Margin="66.7,0,100.05,0.769" Name="_sl_ZoomSlider" Minimum="25" Maximum="200" 
                Value="100" ValueChanged="OnKnowledgeMapZoomChanged" IsSnapToTickEnabled="True" Height="22" />

    </Grid>
</UserControl>
